const displayedImage = document.querySelector('.displayed-img');
const thumbBar = document.querySelector('.thumb-bar');

const btn = document.querySelector('button');
const overlay = document.querySelector('.overlay');

/* 添加图片循环 */
for (let i = 1; i <= 5; i++)
{
    const newImage = document.createElement('img');
    newImage.setAttribute('src', 'images/pic' + i + '.jpg');
    thumbBar.appendChild(newImage);
    newImage.onclick = function(e)
    {
        displayedImage.src = e.target.src;
    }
}

// const newImage = document.createElement('img');
// newImage.setAttribute('src', xxx);
// thumbBar.appendChild(newImage);

/* 编写 变暗/变量 按钮功能 */

btn.onclick = function()
{
    const btnClass = btn.getAttribute();
    if (btnCLass === 'dark')
    {
        btn.setAttribute('class', 'light');
        btn.textContent = '变亮';
        

    }
    else
    {

    }
}
